package com.jobchecks.sms.api;

import com.jobchecks.common.baseresult.JobchecksResult;
import com.jobchecks.sms.api.request.TestAddReq;
import com.jobchecks.sms.api.response.TestAddResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.Size;

/**
 * 测试服务
 *
 * @author huangjinjia
 */
@Api(tags = "测试服务接口")
@RestController("/smsTest")
public interface TestSmsService {

    /**
     * 新增接口
     *
     * @author huangjinjia
     */
    @ApiOperation("新增接口")
    @PostMapping("/smsAdd")
    JobchecksResult<TestAddResp> smsAdd(@ApiParam(value = "新增接口请求参数") @Valid @RequestBody TestAddReq req) ;

    /**
     * 更新接口
     *
     * @author huangjinjia
     */
    @ApiOperation("更新接口")
    @GetMapping("/smsUpdate")
    JobchecksResult smsUpdate(@ApiParam(value = "秘钥") @RequestParam @Size(min = 5, message = "秘钥最小值为5") String key,
                              @ApiParam(value = "配置") @RequestParam(required = false) String conf);


}
